import 'package:factoryside/bean/fee_detail_entity.dart';

feeDetailEntityFromJson(FeeDetailEntity data, Map<String, dynamic> json) {
	if (json['fee'] != null) {
		data.fee = new FeeDetailFee().fromJson(json['fee']);
	}
	if (json['imgs'] != null) {
		data.imgs = json['imgs']?.map((v) => v.toString())?.toList()?.cast<String>();
	}
	return data;
}

Map<String, dynamic> feeDetailEntityToJson(FeeDetailEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	if (entity.fee != null) {
		data['fee'] = entity.fee.toJson();
	}
	data['imgs'] = entity.imgs;
	return data;
}

feeDetailFeeFromJson(FeeDetailFee data, Map<String, dynamic> json) {
	if (json['Id'] != null) {
		data.id = json['Id'] is String
				? int.tryParse(json['Id'])
				: json['Id'].toInt();
	}
	if (json['OrderFeeApplicationID'] != null) {
		data.orderFeeApplicationID = json['OrderFeeApplicationID'] is String
				? int.tryParse(json['OrderFeeApplicationID'])
				: json['OrderFeeApplicationID'].toInt();
	}
	if (json['OrderID'] != null) {
		data.orderID = json['OrderID'] is String
				? int.tryParse(json['OrderID'])
				: json['OrderID'].toInt();
	}
	if (json['FeeNumber'] != null) {
		data.feeNumber = json['FeeNumber'].toString();
	}
	if (json['State'] != null) {
		data.state = json['State'] is String
				? int.tryParse(json['State'])
				: json['State'].toInt();
	}
	if (json['StateTxt'] != null) {
		data.stateTxt = json['StateTxt'].toString();
	}
	if (json['Type'] != null) {
		data.type = json['Type'] is String
				? int.tryParse(json['Type'])
				: json['Type'].toInt();
	}
	if (json['Name'] != null) {
		data.name = json['Name'].toString();
	}
	if (json['ApproveUser'] != null) {
		data.approveUser = json['ApproveUser'].toString();
	}
	if (json['CreateDate'] != null) {
		data.createDate = json['CreateDate'].toString();
	}
	if (json['UpdateTime'] != null) {
		data.updateTime = json['UpdateTime'].toString();
	}
	if (json['ApplicationAmount'] != null) {
		data.applicationAmount = json['ApplicationAmount'] is String
				? int.tryParse(json['ApplicationAmount'])
				: json['ApplicationAmount'].toInt();
	}
	if (json['ApplicationNotes'] != null) {
		data.applicationNotes = json['ApplicationNotes'].toString();
	}
	if (json['ReviewNotes'] != null) {
		data.reviewNotes = json['ReviewNotes'].toString();
	}
	if (json['IsUse'] != null) {
		data.isUse = json['IsUse'].toString();
	}
	if (json['Version'] != null) {
		data.version = json['Version'] is String
				? int.tryParse(json['Version'])
				: json['Version'].toInt();
	}
	return data;
}

Map<String, dynamic> feeDetailFeeToJson(FeeDetailFee entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['Id'] = entity.id;
	data['OrderFeeApplicationID'] = entity.orderFeeApplicationID;
	data['OrderID'] = entity.orderID;
	data['FeeNumber'] = entity.feeNumber;
	data['State'] = entity.state;
	data['StateTxt'] = entity.stateTxt;
	data['Type'] = entity.type;
	data['Name'] = entity.name;
	data['ApproveUser'] = entity.approveUser;
	data['CreateDate'] = entity.createDate;
	data['UpdateTime'] = entity.updateTime;
	data['ApplicationAmount'] = entity.applicationAmount;
	data['ApplicationNotes'] = entity.applicationNotes;
	data['ReviewNotes'] = entity.reviewNotes;
	data['IsUse'] = entity.isUse;
	data['Version'] = entity.version;
	return data;
}